<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		
		<title>用户注册 - MySNS</title>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

		<link rel="stylesheet" type="text/css"
			href="<c:url value="/web/resources/styles/footer.css" />">
		<link rel="stylesheet" type="text/css"
			href="<c:url value="/web/resources/styles/header.css" />">
		<link rel="stylesheet" type="text/css"
			href="<c:url value="/web/resources/styles/register.css" />">
			
		
		<script type="text/javascript"
			src="<c:url value="/web/resources/scripts/jquery/jquery-1.6.1.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/web/resources/scripts/register.js"/>"></script>
		
		<script type="text/javascript">
			// 当用户敲下Enter键的时候自动注册
			$(document).keypress(function (event) {
				if (event.keyCode == 13) {
					check();
				}
			});
		</script>
		
	</head>

	<body>
		<div class="register_page">

				<div class="header">
					<div class="tmenu">
    					<a href="<c:url value="/account/login"/>" target="_blank">登录</a>
						| <a href="#" target="_blank">帮助</a>
    				</div>
    				<h1 class="head_logo">
        				<a href="<c:url value="/index"/>" class="at_gohome" title="logo"></a>
    				</h1>
				</div>

				<div class="register_main">
				
					<div class="navigator">    	
						<div class="at_loc">
           					<span class="now">1.填写用户名和密码</span>
            				<span class="line_frist"></span>
            			<span>2.注册成功</span>
            			<span class="line_end"></span>
        				</div>	
        				<p class="crumb gray3">
            			<span class="gray1">您的位置：</span>
                		<a href="<c:url value="/index"/>">首页</a> &gt; <a href="<c:url value="account/register"/>" target="_blank">注册会员</a>
            			</p>
            			
    				</div>
    				
    				
    				<div class="reg_box">
    		<div class="tit">
        		<b class="gray1">快速注册</b>(*为必填项)                
    		</div>
        <div class="reg_form">
            <form id="reg_box" name="frm_reg" method="post" action="<c:url value="/account/register"/>">
            	
            <script type="text/javascript">
				// 检测如果没有输入用户名或密码，则提示错误，并且不提交表单
				function check() {
					if (validateAll()) {
						// 改变按钮样式为"载入中..."，同时提交表单登录
						document.forms[0].submit();
					}
				}
			</script>
			
            <div class="page_table">
						<table border="0" cellpadding="0" cellspacing="0" width="100%">
							<tbody>
								<!-- 用户名 -->
								<tr>
									<td align="right" valign="top" width="100px">
										<span class="page_text01">用户名：</span>
									</td>
									<td valign="top" width="12">
										<span class="red"> * </span>
									</td>
									<td width="300">
										<input id="TextBox_LoginName"
											name="loginName"
											class="shuruk"
											onblur="return blurtoRemind(this.id)"
											onfocus="focustoRemind(this.id)"
											type="text" />
										<br>
									</td>
									<td valign="top">
										<div id="loginid_info">
											<c:if test="${! empty nameErr}">
												<span class="promptMsg2">${nameErr}</span>
											</c:if>
											<c:if test="${! empty nameRptErr}">
												<span class="promptMsg2">${nameRptErr}</span>
											</c:if>
										</div>
									</td>
								</tr>
								<!-- 电子邮箱 -->
								<tr>
									<td align="right" valign="top">
										<span class="page_text01">电子邮箱：</span>
									</td>
									<td valign="top">
										<span class="red"> * </span>
									</td>
									<td>
										<input id="TextBox_Email"
											name="email"
											class="shuruk"
											onblur="return blurtoRemind(this.id)"
											onfocus="focustoRemind(this.id)"
											type="text" />
										<br/>
									</td>
									<td valign="top">
										<div id="email_info">
											<c:if test="${! empty emailErr}">
												<span class="promptMsg2">${emailErr}</span>
											</c:if>
											<c:if test="${! empty emailRptErr}">
												<span class="promptMsg2">${emailRptErr}</span>
											</c:if>
										</div>
									</td>
								</tr>
								<!-- 输密码 -->
								<tr>
									<td align="right" valign="top">
										<span class="page_text01">密码：</span>
									</td>
									<td valign="top">
										<span class="red"> * </span>
									</td>
									<td>
										<input id="TextBox_PWD"
											name="password1"
											class="shuruk"
											onblur="return blurtoRemind(this.id)"
											onfocus="focustoRemind(this.id)"
											type="password" />
										<br/>
									</td>
									<td valign="top">
										<div id="password_info">
											<c:if test="${! empty pwd1Err}">
												<span class="promptMsg2">${pwd1Err}</span>
											</c:if>
										</div>
									</td>
								</tr>
								<!-- 重输密码 -->
								<tr>
									<td align="right" valign="top">
										<span class="page_text01">确认密码：</span>
									</td>
									<td valign="top">
										<span class="red"> * </span>
									</td>
									<td>
										<input id="TextBox_PWDConfirm"
											name="password2"
											class="shuruk"
											onblur="return blurtoRemind(this.id)"
											onfocus="focustoRemind(this.id)" 
											type="password" />
										<br/>
									</td>
									<td valign="top">
										<div id="confirm_password_info">
											<c:if test="${! empty pwd2Err}">
												<span class="promptMsg2">${pwd2Err}</span>
											</c:if>
										</div>
									</td>
								</tr>
								<!-- 选择用户身份 -->
								<!-- 
								<tr>
									<td align="right" valign="top">
										<span class="page_text01">请选择您的身份：</span>
									</td>
									<td valign="top">
										<span class="red"> * </span>
									</td>
									<td>
										<select name="state">
											<option selected="selected" value="0">
												请选择身份
											</option>
											<option value="1">学生</option>
											<option value="2">企业</option>
										</select>
									<br/>
									</td>
								</tr>
								 -->
								 
								 <!-- 验证码 -->
								<tr>
									<td align="right" valign="top" width="125">
										<span class="page_text01">验证码：</span>
									</td>
									<td valign="top" width="12">
										<span class="red"> * </span>
									</td>
									<td width="300">
										<input id="TextBox_CheckCode"
											name="checkcode"
											class="shuruk"
											onblur="return blurtoRemind(this.id)"
											onfocus="focustoRemind(this.id)" />
										<img id="checkCode"
											title="看不清楚，点击换一张"
											width="55"
											height="25"
											onclick="refreshImage();"
											src="<c:url value="/kaptcha/image"/>"
											style="border-width: 0px" />
										<script type="text/javascript">
											// 点击生成新的验证码
											function refreshImage() {
												$("#checkCode")
													.hide()
													.attr("src", "kaptcha/image?time=" + (new Date()).getTime())
													.fadeIn();
											}
										</script>
										<br>
									</td>
									<td valign="top">
										<div id="validate_code_info">
											<c:if test="${! empty codeErr}">
												<span class="promptMsg2">${codeErr}</span>
											</c:if>
										</div>
									</td>
								</tr>
								<tr>
									<td align="right" valign="top" width="125">
										&nbsp;
									</td>
									<td valign="top" width="12">
										&nbsp;
									</td>
									<td width="300">
										<a style="font-size: 14px;" class="black"
											href="#"
											target="_blank">阅读网站使用条款</a>
										
									</td>
									<td valign="top">
										&nbsp;<a id="LinkButton_Sure" class="page_RegisterBtn"
											onclick="return check();"
											href='javascript:check();'>
										</a>
									</td>
								</tr>
								<tr>
									<td align="right" valign="top" width="125">
										&nbsp;
									</td>
									<td valign="top" width="12">
										&nbsp;
									</td>
									<td width="300">		
											<a id="LinkButton_Sure" class="at_but b_1_y" tabindex="1" href="javascript:document.forms[0].submit();" onclick="document.forms[0].submit();">
            								<u></u>
            								注册
            							</a>								
									</td>
									<td valign="top">
										&nbsp;
									</td>
								</tr>
							</tbody>
						</table>
						</div>
						</form>
						<div class="clear"></div>
					</div>
		    
			<div class="clear"></div>
                        
        </div>
				<div class="footer">
    			<p>
					<a href="#" target="_blank">关于我们</a>|
    				<a href="#" target="_blank">联系方式</a>|
    				<a href="#" target="_blank">网站地图</a>
    			</p>
    			<p class="copyright">Copyright 2010-2011 MySNS.com<a href="#" title="返回首页"></a> 版权所有 粤ICP备10202274号</p>
			</div>
	</div>
	</div>
	</body>
</html>
